<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <!-- 基础元数据 -->
    <meta charset="utf-8">
    <title>电商平台</title>
    <meta name="keywords" content="电商,购物,线上商城">
    <meta name="description" content="优质商品尽在电商平台">
    
    <!-- 移动端适配 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    
    <!-- 缓存控制 -->
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    
    <!-- CSS 资源 -->
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/app.css">
    <link rel="stylesheet" href="/static/css/myself.css">
    
    <!-- JavaScript 放在body底部 -->
</head>

<body>
    <!-- 导航栏 -->
    <header class="navbar navbar-default">
        <div class="container-fluid">
            <!-- 顶部快速链接 -->
            <div class="quick-links">
                <div class="user-links">
                    <a href="/user/login/" class="btn btn-link">登录</a>
                    <a href="/user/register/" class="btn btn-link">注册</a>
                    <a href="/user/logout/" class="btn btn-link">退出</a>
                </div>
                
                <!-- 搜索框 -->
                <form method="get" action="/search" class="navbar-form navbar-left search-form">
                    <div class="form-group">
                        <input type="text" name="q" class="form-control search-input" placeholder="搜索商品">
                        <button type="submit" class="btn btn-default search-btn">搜索</button>
                    </div>
                </form>
                
                <!-- 主导航菜单 -->
                <nav class="main-nav">
                    <ul class="nav navbar-nav">
                        <li><a href="/index/">首页</a></li>
                        <li><a href="/goods/">分类</a></li>
                        <li><a href="/cart/show_cart/">购物车</a></li>
                        <li><a href="/cart/place_order/">我的订单</a></li>
                        <li><a href="/user_center/">个人中心</a></li>
                        
                        <!-- 用户信息下拉菜单 -->
                        {% if request.session.info.username %}
                        <li class="dropdown user-dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                {{ request.session.info.username }}
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu">
                                <li><a href="/user_center/">个人资料</a></li>
                                <li><a href="/user/change_password/">修改密码</a></li>
                                <li role="separator" class="divider"></li>
                                <li><a href="/user/logout/">退出登录</a></li>
                            </ul>
                        </li>
                        {% endif %}
                    </ul>
                </nav>
            </div>
        </div>
    </header>

    <!-- 主内容区 -->
    <main class="container" id="content">
        {% block content %}
        <!-- 页面特定内容将在这里插入 -->
        {% endblock %}
    </main>

    <!-- 底部导航栏 -->
    <footer class="navbar navbar-default navbar-fixed-bottom footer-nav">
        <div class="container">
            <div class="footer-icons">
                <a href="/index/" class="footer-icon">
                    <img src="/static/images/j1.jpg" alt="首页">
                    <span>首页</span>
                </a>
                <a href="/goods/" class="footer-icon">
                    <img src="/static/images/j2.jpg" alt="分类">
                    <span>分类</span>
                </a>
                <a href="/cart/show_cart/" class="footer-icon">
                    <img src="/static/images/j3.jpg" alt="购物车">
                    <span>购物车</span>
                </a>
                <a href="/user_center/" class="footer-icon">
                    <img src="/static/images/j4.jpg" alt="我的">
                    <span>我的</span>
                </a>
            </div>
        </div>
    </footer>

    <!-- JavaScript 资源 -->
    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
    
    {% block extra_js %}
    <!-- 页面特定的JS可以放在这里 -->
    {% endblock %}
</body>

</html>
